<template>
  <div class="line_display">
    <!-- 数字指标-->
    <div class="gao_liang">
      <a-row>
        <a-col :xs="10" :sm="8" :md="7" :lg="5" :xl="4" style="text-align: right;">
          <span style="margin-right: 8px;">数字动画</span>
          <a-tooltip>
            <template slot="title">
              是否启用数字跳动动画
            </template>
            <a-icon type="exclamation-circle" />
          </a-tooltip>
          ：
        </a-col>
        <a-col :xs="14" :sm="16" :md="17" :lg="19" :xl="20">
          <a-switch checked-children="开" un-checked-children="关" v-model="form.display.animated" />
        </a-col>
      </a-row>
      <a-row>
        <a-col :xs="10" :sm="8" :md="7" :lg="5" :xl="4" style="text-align: right;">
          <span style="margin-right: 8px;">指标单位</span>
          <a-tooltip>
            <template slot="title">
              显示指标单位
            </template>
            <a-icon type="exclamation-circle" />
          </a-tooltip>
          ：
        </a-col>
        <a-col :xs="14" :sm="16" :md="17" :lg="19" :xl="20">
          <a-input placeholder="请输入指标单位" v-model="form.display.unit" />
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script>
import bus from '@/views/components/bus';
  export default {
    props: ['display', 'form'],
    data() {
      return {}
    },
    methods: {
      onSubmit () {
        const _chartForm = this.form.display
        if (!_chartForm.unit) return false
        return  true
      },
    },
    mounted() {
      bus.$on('verifyForm',(back)=>{
        back(this.onSubmit())
      }) 
    },
    beforeDestroy() {
      bus.$off('verifyForm')
    },
  }
</script>

<style scoped>

.gao_liang div {
  line-height: 40px;
}

.mu_biao_xian {
  display: flex;
  justify-content: space-around;
}

.mu_biao_xian input {
    width: 45%;
}

.tu_li_position {
  display: flex;
  justify-content: space-around;
}

.tu_li_position input {
  width: 19%;
}
</style>